package com.example.lol.ui.me;

import android.view.View;

import androidx.viewpager.widget.ViewPager;

import com.example.lol.R;
import com.example.lol.base.BaseFragment;
import com.example.lol.bean.NewsTypeBean;
import com.google.android.material.tabs.TabLayout;

public class MeMainFragment extends BaseFragment {
    private TabLayout topTL;
    private ViewPager topVP;
    private MeVpAdapter meVpAdapter;

    @Override
    protected int rootLayout() {
        return R.layout.fragment_me;
    }

    @Override
    protected void initView(View view) {
        topVP = view.findViewById(R.id.me_page);
        topTL = view.findViewById(R.id.me_button);
    }

    @Override
    protected void initData() {
        meVpAdapter = new MeVpAdapter(getChildFragmentManager());
        topVP.setAdapter(meVpAdapter);
        topTL.setupWithViewPager(topVP);
        topTL.setInlineLabel(true);
    }

    @Override
    protected void bindData() {
        super.bindData();
        meVpAdapter.addData(new NewsTypeBean(NewsTypeBean.TYPE_ARTICLE,"战绩"));
        meVpAdapter.addData(new NewsTypeBean(NewsTypeBean.TYPE_ARTICLE,"帖子"));
    }

    @Override
    protected void bindEvent() {

    }
}
